{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 7.3 L, L over D, K, and Kv for Conventional Type Valves"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "A 100 mm class 600 steel angle valve, has a full area seat.\n",
    "\n",
    "Calculate its resistance coefficient K, flow coefficient Kv, the equivalent length of it L/D, and the length for complete turbulent L."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Loss coefficient = 2.4729637821072443 dimensionless\n",
      "Valve flow coefficient = 240.31652930826877 meter ** 3 / hour\n",
      "Equivalent length = 149.8765928549845 dimensionless\n",
      "Length for complete turbulence = 14.568004825504492 meter\n"
     ]
    }
   ],
   "source": [
    "from fluids.units import *\n",
    "NPS, Di, Do, t = nearest_pipe(Do=0.103*u.m, schedule='80')\n",
    "fd = 0.0165 # provided - note equivalent length is proportional to this value\n",
    "d = 0.0972*u.m # diameter of seat\n",
    "K = K_angle_valve_Crane(D1=d, D2=Di, fd=fd, style=1)\n",
    "Kv = K_to_Kv(K, d)\n",
    "L_D = L_equiv_from_K(K, fd)\n",
    "L = L_D*d\n",
    "\n",
    "print('Loss coefficient = %s' %K)\n",
    "print('Valve flow coefficient = %s' %Kv)\n",
    "print('Equivalent length = %s' % L_D)\n",
    "print('Length for complete turbulence = %s' %L)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The values given in the solution are K=2.475, Kv = 240.2, L/D=150, and L = 14.6."
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
